home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / etc / dbus-1 / event.d / 22dhcdbd < prev    next >
Encoding:
Text File  |  2007-03-05  |  1.1 KB  |  64 lines

  1. #! /bin/sh
  2. #
  3. # DHCP D-Bus daemon
  4. #
  5. # Author: Michael Biebl <biebl@debian.org>    
  6. #
  7.  
  8. set -e
  9.  
  10. PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
  11. DESC="DHCP D-Bus daemon"
  12. NAME="dhcdbd"
  13. DAEMON=/usr/sbin/$NAME
  14. DAEMON_OPTS=--system
  15. PIDFILE=/var/run/$NAME.pid
  16. SCRIPTNAME=/etc/dbus-1/event.d/24$NAME
  17.  
  18. # Gracefully exit if the package has been removed.
  19. test -x $DAEMON || exit 0
  20.  
  21. . /lib/lsb/init-functions
  22.  
  23. #
  24. #    Function that starts the daemon/service.
  25. #
  26. d_start() {
  27.     start-stop-daemon --start --quiet --pidfile $PIDFILE \
  28.         --exec $DAEMON -- $DAEMON_OPTS
  29. }
  30.  
  31. #
  32. #    Function that stops the daemon/service.
  33. #
  34. d_stop() {
  35.     start-stop-daemon --stop --quiet --pidfile $PIDFILE \
  36.          --oknodo --retry 60 --exec $DAEMON
  37. }
  38.  
  39.  
  40. case "$1" in
  41.   start)
  42.         log_daemon_msg "Starting $DESC" "$NAME"
  43.     d_start
  44.     log_end_msg $?
  45.     ;;
  46.   stop)
  47.     log_daemon_msg "Stopping $DESC" "$NAME"
  48.     d_stop
  49.     log_end_msg $?
  50.     ;;
  51.   restart|force-reload)
  52.     log_daemon_msg "Restarting $DESC" "$NAME"
  53.     d_stop
  54.     d_start
  55.     log_end_msg $?
  56.     ;;
  57.   *)
  58.     echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
  59.     exit 1
  60.     ;;
  61. esac
  62.  
  63. exit 0
  64.